package org.example.domain;


import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableLogic;
import com.fasterxml.jackson.annotation.JsonInclude;
import lombok.Data;

import javax.validation.constraints.NotNull;
import javax.validation.constraints.Null;


@Data
@JsonInclude(JsonInclude.Include.NON_NULL)
public class Goods {
    public interface Save{};
    public interface Update{};
    @TableId("id")
    @NotNull(message ="商品id不能为空",groups = {Update.class})
    @Null(message ="商品ID必须为空",groups = {Save.class})
    private Integer goodsId;
    @TableField("goods_name")
    @NotNull(message = "商品名字不能为空",groups = {Save.class})
    private String name;
    private Integer price;
    private String img;
    private String  type;
    @TableLogic
    @TableField(select = false)
    private Integer deleted;//对应的实体字段，实体字段需要根据数据库字段命名

    @TableField(exist = false)
    private String information;

}
